<template>
  <a-card :bordered="false" class="card-area">
    <!-- 查询区域 11111-->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" :label-col="labelCol" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="6">
            <a-form-item label="售卖渠道">
              <a-select placeholder="请选择所属菜品类型" v-model="queryParam.cpType">
                <a-select-option value="0">店内</a-select-option>
                <a-select-option value="1">店外</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="9">
            <a-form-item label="选择时间">
              <j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.beginTime"></j-date>
              <span class="query-group-split-cust"></span>
              <j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.endTime"></j-date>
            </a-form-item>
          </a-col>
          <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
           <a-col :md="6" :sm="24">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
           </a-col>
        </span>
        </a-row>
      </a-form>
    </div>
    <a-row>
      <a-divider orientation="left">
        实时概况
      </a-divider>
      <div class="el-row" style="margin-left: -10px; margin-right: -10px;">
        <div class="el-col el-col-6 is-guttered" style="padding-right: 10px; padding-left: 10px;">
          <div class="pb16 grid-content bg-purple">
            <div>商品总数</div>
            <div class="detail_prici">{{goods.totalCount}}</div>
          </div>
        </div>
        <div class="el-col el-col-6 is-guttered" style="padding-right: 10px; padding-left: 10px;">
          <div class="pb16 grid-content bg-purple">
            <div>已上架商品</div>
            <div class="detail_prici">{{goods.putCount}}</div>
          </div>
        </div>
        <div class="el-col el-col-6 is-guttered" style="padding-right: 10px; padding-left: 10px;">
          <div class="pb16 grid-content bg-purple">
            <div>已下架商品</div>
            <div class="detail_prici">{{goods.offCount}}</div>
          </div>
        </div>
      </div>
    </a-row>

    <!-- 操作按钮区域 -->
    <div class="table-operator">

    </div>

    <!-- table区域-begin -->
    <div style="margin-top: 50px">
      <!--      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
      <!--        <i class="anticon anticon-info-circle ant-alert-icon"></i>-->
      <!--        <span>已选择</span>-->
      <!--        <a style="font-weight: 600">-->
      <!--          {{ selectedRowKeys.length }}-->
      <!--        </a>-->
      <!--        <span>项</span>-->
      <!--        <a style="margin-left: 24px" @click="onClearSelected">清空</a>-->
      <!--      </div>-->
      <a-divider orientation="left">
        实时概况
      </a-divider>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">


      </a-table>
    </div>
    <!-- table区域-end -->
  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { putAction, getAction, postAction } from '@/api/manage'
import { frozenBatch } from '@/api/api'
import JDate from '@/components/jeecg/JDate'
export default {
  name: 'ord_store_memberList',
  mixins: [JeecgListMixin],
  components: {
    JDate
  },
  data() {
    return {
      description: '餐饮会员信息管理页面',
      labelCol: { style: { width: '110px' } },
      disableMixinCreated:true,
      queryParam:{
        cpType:"0"
      },
      // 表头
      columns: [
        {
          title: '菜品名称',
          align: 'center',
          dataIndex: 'cpName'
        },
        {
          title: '菜品价格',
          align: 'center',
          dataIndex: 'salePrice'
        },
        {
          title: '菜品销量',
          align: 'center',
          dataIndex: 'saleQty'
        },
        {
          title: '菜品总销售额',
          align: 'center',
          dataIndex: 'incomeAmount'
        },
      ],
      url: {
        goods: '/store/report/goods',
        list:'/store/report/goods/page'
      },
      goods:{
        totalCount:0,
        putCount:0,
        offCount:0,
      },
    }
  },
  created() {
    const that = this
    let ymd = this.getDate2Ymd();
    that.queryParam.beginTime = ymd;
    that.queryParam.endTime = ymd;
    that.searchQuery();
  },
  methods: {
    searchQuery() {
      const that=this;
      var params1={}
       getAction(this.url.goods,params1).then((res) => {
         if (res.success) {
           this.goods=res.result;
         }
       })
      this.loadData(1);
      // 点击查询清空列表选中行
      // https://gitee.com/jeecg/jeecg-boot/issues/I4KTU1
      this.selectedRowKeys = []
      this.selectionRows = []
    },
  }
}
</script>
<style scoped>
.el-row {
  display: flex;
  flex-wrap: wrap;
  position: relative;
  box-sizing: border-box;
}
guttered {
  display: block;
  min-height: 1px;
}
.el-col {
  border-radius: 4px;
}
.el-col-6 {
  max-width: 25%;
  flex: 0 0 25%;
}

.bg-purple {
  background: #f4f4f4;
}

.grid-content {
  padding: 20px;
  border-radius: 4px;
  min-height: 36px;
}
.pb16 {
  padding-bottom: 16px;
}

.detail_prici {
  font-size: 20px;
  color: #000;
  font-weight: 700;
  margin-top: 10px;
  max-width: 250px;
}
</style>
